<script setup>
	import {
		ref,
		computed,
		reactive,
		onMounted
	} from 'vue';
	import {
		onLoad,
		onShow
	} from '@dcloudio/uni-app';
	import {
		getFuwuApi
	} from '/api/request.js';
	const platform = uni.getStorageSync('platform');
	let types = 1;
	const info = ref({});
	onLoad(async (type) => {
		if (type) {
			types = type.type;
		}
		let res = await getFuwuApi({
			type: type.type
		})
		if (res.code == -1) {
			uni.showToast({
				title: res.msg,
				icon: 'none'
			});
		}

		info.value = res.data;
	});
	const props = defineProps({});
	const goback = () => {
		uni.navigateBack()
	}
</script>

<template>
	<view class="header-wrap uni-row" :style="{
				paddingTop:platform.dingbu+'rpx',
	height:platform.dingbu+96+'rpx'			
			}">
		<image @click="goback" class="left" src="/static/img/goback-black.png" mode="widthFix" />
		<view class="title">
			{{types == 1 ? '服务协议' : '隐私政策'}}
		</view>
		<image class="left" style="opacity: 0;" src="/static/img/goback-black.png" mode="widthFix" />
	</view>
	<scroll-view class="xilie" :scroll-y="true" :style="{ 	height:platform.gaodu -platform.dingbu-96  +'rpx' }">
		<rich-text :nodes="info.content"></rich-text>
	</scroll-view>
</template>

<style scoped lang="less">
	.header-wrap {
		justify-content: space-between;
		padding-left: 24rpx;
		padding-right: 24rpx;

		.left {
			width: 48rpx;
		}

		.title {
			font-weight: 500;
			font-size: 32rpx;
			color: #333333;
		}
	}

	.xilie {
		padding: 28rpx;
		background-color: #f7f7f7;
		font-weight: 400;
		font-size: 28rpx;
		line-height: 40rpx;
	}
</style>